package com.qf.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.mapper.DtsUserMapper;
import com.qf.mapper.IndexTotalMapper;
import com.qf.pojo.DtsUser;
import com.qf.vo.DayStatis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author sunyamei
 * @version V1.0
 * @Project javase2203
 * @Package com.qf.service
 * @Description:
 * @Date 2022/7/26 11:31
 */
@Service
public class UserServiceImpl implements  UserService {

    @Autowired
    private DtsUserMapper userMapper;

    @Autowired
    private IndexTotalMapper indexTotalMapper;

    @Override
    public int userCount() {

        //创建查询条件
        QueryWrapper<DtsUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("deleted",false);
        Integer count = userMapper.selectCount(queryWrapper);
        return count;
    }

    /**
     * 统计日期和对应的用户增长量
     * @return
     */
    @Override
    public List<DayStatis> userCnts() {
        List<DayStatis> list = indexTotalMapper.userCnts();
        return list;
    }
}
